<template>
  <view class="inforamtion" style="display: flex;">
  	<view>
			<view class="option" style="width: 520rpx;">
				<view class="lf">岗位序列</view>
				<view class="rl">{{ filterMultiDictText(dictOptions['positionCategory'], item.positionCategory + '') }}</view>
			</view>
  		<view class="option" style="width: 520rpx;">
  			<view class="lf">岗位名称</view>
  			<view class="rl">{{ filterMultiDictText(dictOptions['postId'], item.postId + '') }}</view>
  		</view>
  		<view class="option" style="width: 520rpx;">
  			<view class="lf">工作地点</view>
  			<view class="rl">{{ item.workAddress }}</view>
  		</view>
			<view class="option" style="width: 520rpx;">
				<view class="lf">所需人数</view>
				<view class="rl">{{ item.requireQuantity }}</view>
			</view>
			<view class="option" style="width: 520rpx;">
				<view class="lf">学历要求</view>
				<view class="rl">{{ filterMultiDictText(dictOptions['educationalRequirements'], item.educationalRequirements + '') }}</view>
			</view>
			<view class="option" style="width: 520rpx;">
				<view class="lf">性别要求</view>
				<view class="rl">{{ filterMultiDictText(dictOptions['sexRequirements'], item.sexRequirements + '') }}</view>
			</view>
			<view class="option" style="width: 520rpx;">
				<view class="lf">专业要求</view>
				<view class="rl">{{ filterMultiDictText(dictOptions['professionalRequirement'], item.professionalRequirement + '') }}</view>
			</view>
			<view class="option" style="width: 520rpx;">
				<view class="lf">工作经验</view>
				<view class="rl">{{ filterMultiDictText(dictOptions['workExperience'], item.workExperience + '') }}</view>
			</view>
			<view class="option" style="width: 520rpx;">
				<view class="lf">薪资区间（元）</view>
				<view class="rl">{{ item.salarySection }}</view>
			</view>
			<view class="option" style="width: 520rpx;">
				<view class="lf">期待到岗时间</view>
				<view class="rl">{{ item.expectationTime }}</view>
			</view>
  	</view>
  	<view  style="flex: 1; display: flex; align-items: center; justify-content: flex-end;">
  		<u-icon name="edit-pen-fill" color="#2979ff" size="20" @click="handleEidtForm(item)"></u-icon>
  		<u-line  direction="col" length="20" margin="0 10rpx"></u-line>
  		<u-icon name="trash-fill" color="#2979ff" size="20" @click="handleRemoveForm(item)"></u-icon>
  	</view>
  </view>
</template>
	
	
	
  <!-- <u-form labelWidth="auto" disabled>
    <view class="basic-style">
      <u-form-item label="岗位名称" prop="postId" required>
        <h-select-input-tag
          disabled
          class="w-100"
          v-model="item.postId"
          objectField="item.postId"
          placeholder="请选择岗位"
          border="none"
          dictName="sys_position,name,id,del_flag = 0 and audit_status=2"
        ></h-select-input-tag>
      </u-form-item>
      <u-form-item label="工作地点" prop="workAddress" required>
        <u--input disabled border="none" placeholder="请输入工作地点" v-model="item.workAddress"></u--input>
      </u-form-item>
      <u-form-item label="所需人数" prop="requireQuantity" required>
        <u--input
          disabled
          border="none"
          type="number"
          v-number-normal
          placeholder="请输入所需人数"
          v-model="item.requireQuantity"
        ></u--input>
      </u-form-item>
      <u-form-item label="学历要求" prop="educationalRequirements" required>
        <h-select-input-tag
          disabled
          class="w-100"
          v-model="item.educationalRequirements"
          objectField="item.educationalRequirements"
          placeholder="请选择学历要求"
          border="none"
          dictName="educational_requirements"
        ></h-select-input-tag>
      </u-form-item>
      <u-form-item label="性别要求" prop="sexRequirements" required>
        <h-select-input-tag
          disabled
          class="w-100"
          v-model="item.sexRequirements"
          objectField="item.sexRequirements"
          placeholder="请选择性别要求"
          border="none"
          dictName="sex_requirements"
        ></h-select-input-tag>
      </u-form-item>
      <u-form-item label="专业要求" prop="professionalRequirement" required>
        <h-select-input-tag
          disabled
          class="w-100"
          v-model="item.professionalRequirement"
          objectField="item.professionalRequirement"
          placeholder="请选择专业要求"
          border="none"
          dictName="professional_requirement"
        ></h-select-input-tag>
      </u-form-item>
      <u-form-item label="工作经验" prop="workExperience" required>
        <h-select-input-tag
          disabled
          class="w-100"
          v-model="item.workExperience"
          objectField="item.workExperience"
          placeholder="请选择工作经验"
          border="none"
          dictName="work_experience"
        ></h-select-input-tag>
      </u-form-item>
      <u-form-item label="薪资区间（元）" prop="salarySection" required>
        <u--input disabled border="none" placeholder="请输入薪资区间（元）" v-model="item.salarySection"></u--input>
      </u-form-item>
      <u-form-item label="期待到岗时间" prop="expectationTime" required>
        <h-time-select
          disabled
          mode="datetime"
          ref="remittanceDate"
          v-model="item.expectationTime"
          placeholder="请选择期待到岗时间"
          border="none"
          suffixIcon="calendar-fill"
          :suffixIconStyle="{ color: '#B2B2B2' }"
        ></h-time-select>
      </u-form-item>
    </view>
  </u-form>
</template> -->

<script>
import { filterMultiDictText, initDictOptions } from '@/utils/JDictSelectUtil.js'
export default {
  name: 'JobFormInfo',
  props: {
    index: {
      type: Number,
      default: null,
    },
    item: {
      type: Object,
      default: () => ({}),
    }
  },
  data() {
    return {
      filterMultiDictText,
      initDictOptions,
      dictOptions: {},
    }
  },
  watch: {
    item: {
      handler(val) {
        if (val) {
          this.initDictConfig()
        }
      },
      immediate: true,
      deep: true,
    },
  },
  methods: {
		initDictConfig() {
			initDictOptions('sys_position,name,id,del_flag = 0 and audit_status=2').then((res) => {
				if (res.success) {
					this.$set(this.dictOptions, 'postId', res.result)
				}
			})
			initDictOptions('position_category').then((res) => {
				if (res.success) {
					this.$set(this.dictOptions, 'positionCategory', res.result)
				}
			})
			initDictOptions('educational_requirements').then((res) => {
				if (res.success) {
					this.$set(this.dictOptions, 'educationalRequirements', res.result)
				}
			})
			initDictOptions('sex_requirements').then((res) => {
				if (res.success) {
					this.$set(this.dictOptions, 'sexRequirements', res.result)
				}
			})
			initDictOptions('professional_requirement').then((res) => {
				if (res.success) {
					this.$set(this.dictOptions, 'professionalRequirement', res.result)
				}
			})
			initDictOptions('work_experience').then((res) => {
				if (res.success) {
					this.$set(this.dictOptions, 'workExperience', res.result)
				}
			})
		},
    handleCopyForm(item) {
      this.$emit('copy', [item, this.index])
    },
    handleEidtForm(item) {
      this.$emit('edit', [item, this.index])
    },
    handleRemoveForm(item) {
			uni.showModal({
			  content: '确定删除吗？',
			  success: (res) => {
			    if (res.confirm) {
			      this.$emit('remove', item)
			    }
			  },
			})
    },
  }
}
</script>

<style scoped lang="scss">
.inforamtion {
  margin-top: 10rpx;
  padding: 10rpx;
  border-radius: 15rpx;
  box-shadow: 0px 4px 20px 0px rgba(0, 0, 0, 0.1);
}
</style>
